//heap.h
//  Define ThreadHeap, which is a heap of threads. As a heap it has lg(n) push
//  and pop times.
#ifndef HEAP_H
#define HEAP_H

class ThreadHeap {
public:
    ThreadHeap();
    ~ThreadHeap();
    void readyOne();
    bool isEmpty();
    void push(Thread* thread);
    Thread* pop();
    void print();
private:
    Thread** heap;
    int size;
    int storage;

    void grow();
    bool leftLess(Thread* left, Thread* right);
};

#endif //defined HEAP_H
